package com.ruoyi.common.core.enums;

import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

public enum CacheKey implements CacheKeyService {
    /*用户信息*/
    USER_INFO("user-info-"),
    /*用户信息*/
    ROOM_WEBHOOK("web-hook-"),
    /*福袋信息*/
    LUCKY_BAG_INFO("lucky-bag-info-"),
    /*房间上麦用户*/
    ROOM_MAI("room-mai:{roomNumber}:"),
    /*房间上麦用户*/
    ROOM_RANK("room-rank:{roomNumber}:"),
    /* 房间拍拍*/
    ROOM_MOMENT_RANK("room-auction-rank:{roomNumber}:"),
    /*房间在线人数*/
    ROOM_ONLINE("room-onLine:{roomNumber}:"),
    /*房间连线用户*/
    ROOM_LIAN("room-lian:{roomNumber}:"),
    /*房间详情*/
    ROOM_INFO("room-info-"),
    /*房间设置*/
    ROOM_SET("room-set-"),
    /*用户禁言*/
    USER_SPEAK("user-speak-"),
    //商家信息
    MER_INFO("mer-info-"),
    //动态商品信息
    DYNAMIC_COM("dynamic-commdity-"),
    /*用户关注的人员*/
    ATTENTION_IDS("user-attention-ids-"),
    /*用户的收藏*/
    COLLECT_ARTICLE_IDS("user-collect-article-ids-"),
    /*用户收藏的店铺*/
    COLLECT_MERCHANT_IDS("user-collect-merchant-ids-"),
    /*用户收藏的商品*/
    COLLECT_GOODS_IDS("user-collect-goods-ids-"),
    /*用户的点赞*/
    PRAISE_ARTICLE_IDS("user-praise-ids-"),
    /*用户的点赞*/
    PRAISE_ARTICLE_COMMENT_IDS("user-praise-comment-ids-"),
    /*用户的黑名单*/
    BLACK_LIST_IDS("black-list-ids-"),
    /*房间投票*/
    ROOM_VOTE("room-vote-"),
    /*用户的黑名单*/
    STORE_INFO("store-info-");

    private String key;

    CacheKey(String key) {
        this.key = key;
    }

    public String getKey(String suffix) {
        Assert.isTrue(!StringUtils.isEmpty(suffix), ResultEnum.ERROR_SUFFIX.getMessage());
        return this.key + suffix;
    }


}
